package com.jt.controller;

import com.jt.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@PropertySource(value = "classpath:/msg.properties",encoding = "UTF-8")
public class UserController {

    @Value("${msg}")
    private String msg;

    @GetMapping("/hello")
    public String hello(){
        User user =new User();
        //连点
        user.setSex("女").setName("王东儿").setAge(18);
        return "<h1>HelloSpringBoot"+msg+"</h1>";
    }
}
